<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相对定位搭配绝对定位</title>
    <style>
    .one{
        width: 500px;
        height: 1500px;
        border: 1px solid #000;
        /* margin: 50px 0px 0px 50px; */
    }    
    .two{
        width: 100px;
        height: 100px;
        border: 1px solid #000;
        background: red;
    }
    .absolute{
        position: absolute;
        /* left: 250px;
        top: 250px; */
        right: 250px;
        bottom: 250px;
        z-index: 2;
    }
    .yellow{
        background: yellow;
    }
    .relative{
        position: relative;
    }
    </style>
</head>
<body>
    <div class="one relative">
        <div class="two absolute">

        </div>
        <div class="two yellow">

        </div>
    </div>
</body>
</html>